package de.unidue.langtech.teaching.pp.example;

import java.util.Collection;

import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
import org.apache.uima.fit.component.JCasAnnotator_ImplBase;
import org.apache.uima.fit.util.JCasUtil;
import org.apache.uima.jcas.JCas;

import de.unidue.langtech.teaching.pp.type.TimexEvent;

/**
 * @author Inui
 */
public class TimeBaseline extends JCasAnnotator_ImplBase {
    @Override
    public void process(JCas jcas) throws AnalysisEngineProcessException {
        Collection<TimexEvent> timexEvents = JCasUtil.select(jcas, TimexEvent.class);
        if (timexEvents.size() > 0) {
            System.out.println("The following " + timexEvents.size() + " timex events were found.");
        } else {
            System.out.println("No timex events were found.");
        }
    }
}